# class dog:
#     def __init__(self,name,breed,age):
#         self.name=name
#         self.breed=breed
#         self.age=age
#     def eat(self):
#         print(f"{self.name}正在吃狗粮")
#     def run(self):
#         print(f"{self.run}正奔跑玩耍")
# d1=dog("小吧","哈巴狗","4")
# print(d1.name)
# print(d1.breed)
# print(d1.age)
# d1.eat()
# d1.run()

# class student:
#     def __init__(self,name,id,age):
#         self.name=name
#         self.id=id
#         self.age=age
# s1=student("xcm",456465,20)
# print(s1.name,s1.id,s1.age)

# class Room:
#     def __init__(self,name):
#         self.__name=name
# r1=Room("房间1")
# name=r1._Room__name
# print(name)

# class Employee:
#     def __init__(self,name,year,performance):
#         self.__name=name
#         self.__year=year
#         self.__performance=performance
#     def __cal_salary(self):
#         salary=self.__year*2000 + self.__performance
#         return salary
#     def print_salary(self):
#         print(f"{self.__name}的工資是{self.__cal_salary()}")
# e1=Employee("xcm",2,50000)
# e1.print_salary()

# from datetime import datetime
# today = datetime.now()
# print(type(today))
# print(today)

#     turtle.hideturtle()
#     turtle.end_fill()
#     # turtle.exitonclick()
# Circle("pink",100,0,0)
# Circle("blue",100,-100,100)
# Circle("yellow",100,100,100)

# class House:
#     number=0
#     def __init__(self,name,long,wide):
#         self.name=name
#         self.long=long
#         self.wide=wide
#         House.number+=1
#     def _area(self):
#         print(self.long*self.wide)
# H1=House("别墅",20,10)
# H2=House("小房子",25,10)
# H3=House("大房子",30,10)
# H1._area()
# H2._area()
# H3._area()
# print(House.number)

# class Medicine:
#     def __init__(self,name,price,pd,exp):
#         self.name=name
#         self.__price=price
#         self.__pd=pd
#         self.__exp=exp
#     def guarantee_period(self):
#         print(self.__exp-self.__pd)
#     def is_expire(self):
#         if 2024-self.__pd>=0 :
#             print("没有过期")
#         else:
#             print("过期了")
# M1=Medicine("脑残片",22,2022,2024)
# M2=Medicine("傻逼片",30,2021,2023)
# M1.guarantee_period()
# M2.is_expire()

# class Race:
#     def __init__(self,length,time):
#         self.length=length
#         self.time=time
#     def __add__(self,other):
#         return Race(self.length+other.length,self.time+other.time)
#     def __gt__(self,other):
#         if self.length==other.length:
#             return self.time>other.time
#         else:
#             raise TypeError("无法比较")
#     def __eq__(self,other):
#         if self.length==other.length:
#             return self.time==other.time
#         else:
#             raise TypeError("无法比较")
#     def __str__(self):
#         return f"赛跑长度为{self.length},赛跑时长为{self.time}"
# if __name__=="__main__":
#     team1_1=Race(200,20)
#     team1_2=Race(200,19.8)
#     team1=team1_1+team1_2
#     print(team1)
#     team2_1=Race(200,18.9)
#     team2_2=Race(200,20.1)
#     team2=team2_1+team2_2
#     print(team2)
#     if team1>team2:
#         print("team2取得胜利")
#     else:
#         print("team1取得胜利") 

# 编程题
# class Car:
#     def __init__(self,name):
#         self.name=name
#     def run(self):
#         pass
# class TaxiCar(Car):
#     def __init__(self,name,person_num):
#         super().__init__(name)
#         self.person_num=person_num
#     def run(self):
#         print(f"载人车辆，人数为{self.person_num}")
# class FreigthCar(Car):
#     def __init__(self,name,goods_num):
#         super().__init__(name)
#         self.goods_num=goods_num
#     def run(self):
#         print(f"载物车辆，载物数为{self.goods_num}")
# T1=TaxiCar("出租车",5)
# T1.run()
# F1=FreigthCar("货车",10)
# F1.run()

# class Student:
#     def __init__(self, name, chinese, math, wuli):
#         self.name = name
#         self.chinese = chinese
#         self.math = math
#         self.wuli = wuli
    
#     def total_score(self):
#         return f"学生总分为{self.chinese + self.math + self.wuli}"
    
#     def average_score(self):
#         total = self.chinese + self.math + self.wuli
#         avg = total / 3
#         return f"学生平均分为{avg}"

# S1 = Student("xcm", 98, 99, 100)
# S2 = Student("lwl", 100, 70, 50)

# print(S1.total_score())
# print(S1.average_score())
# print(S2.total_score())
# print(S2.average_score())

















